home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / 1svga.zip / COLOR2.PAS < prev    next >
Pascal/Delphi Source File  |  1994-05-26  |  979b  |  38 lines

  1. { Show Mixed 16 --> 256 Colors }
  2.  
  3. uses Txt,VGA16;
  4.  
  5. { ─────────────── ShowColor ─────────────── }
  6. procedure ShowColor(Ty,X,Y,LenX,LenY:integer);
  7. const Pattern:array[0..3,0..3] of byte=(
  8.     ($55,$AA,$55,$AA),($55,$00,$AA,$00),
  9.     ($44,$11,$44,$11),($44,$00,$11,$00));
  10. var I,J,L,Size:integer;
  11.     A,B:array[0..5000] of byte;
  12. begin
  13.   L:=LenX shr 3; Size:=L*LenY;
  14.   for I:=0 to LenY-1 do FillChar(A[L*I],L,Pattern[Ty,I and 3]);
  15.   for I:=0 to 15 do for J:=0 to 15 do begin
  16.     Conv1to4(A,B,Size,J,I);
  17.     Put(X+LenX*J,Y+LenY*I,LenX,LenY,B);
  18.   end;
  19. end;
  20.  
  21. var I,K:integer;
  22.     Font1:array[0..5000] of byte;
  23. begin
  24.   FileRead('0814one.fnt',0,96,14,Font1);
  25.   SetFont(8,14,32,Font1);
  26.   SetMode(4);
  27.   Bar(0,  0,640, 20,9);
  28.   Bar(0, 20,640,440,1);
  29.   Bar(0,460,640, 20,9);
  30.   Print(16,  3,15,9,'Show Mixed 16 --> 256 Colors');
  31.   Print(16,463,15,9,'Press any key...');
  32.   for I:=0 to 3 do begin
  33.     ShowColor(I,120,45,24,24);
  34.     K:=Key;
  35.   end;
  36.   SetMode(0);
  37. end.
  38.